
*
*
*
#include "box.ch"
REQUEST DBFCDX
RddSetDefault('dbfcdx')
VD1999()
PROCEDURE VD1999()
LOCAL xTela, nCount
public nRec
xTela   := SaveScreen(10,18,21,61)

   Disp_mens({"Reindexacao de Arquivos........."},.f.)
   @ 11, 25 say "Aguarde......." color "bg+*/r"
     if ! file('wnctrl.dbf')
        matwn := {;
        {"WN_WNNOM",   "C",         42,          0},;
        {"WN_WNRED",   "C",          9,          0},;
        {"WN_WNTEL",   "C",         15,          0},;
        {"WN_CLIENT",   "C",         40,          0},;
        {"WN_CLIRED",   "C",         12,          0},;
        {"WN_DATEXP",   "D",          8,          0},;
        {"WN_SYSTEM",   "L",          1,          0},;
        {"WN_REINDX",   "L",          1,          0},;
        {"WN_NSERIE",   "N",          9,          0},;
        {"WN_CODSUP",   "N",          2,          0},;
        {"WN_CODVEN",   "N",          3,          0},;
        {"WN_PEDIDO",   "N",          6,          0},;
        {"WN_CIDADE",   "C",         20,          0},;
        {"WN_PEDINI",   "N",          6,          0},;
        {"WN_PEDFIM",   "N",          6,          0},;
        {"WN_NUGUIA",   "N",          6,          0},;
        {"WN_NCPROD",   "N",          5,          0},;
        {"WN_PORCEN",   "N",          6,          2},;
        {"WN_CODCFO",   "N",          5,          0},;
        {"WN_VAGCFO",   "N",          5,          0},;
        {"WN_NNF",      "N",          5,          0} }

        dbcreate('wnctrl.dbf',matwn)
        use wnctrl  Shared New alias wnctrl
        sele wnctrl
        go top
        append blank
        wnctrl->WN_WNNOM := "Benystar Com Imp Exp Ltda"
        wnctrl->WN_WNRED := "Benystar"
        wnctrl->WN_WNTEL := "011 230 0604"
        wnctrl->WN_CLIENT := "Benystar Com Importacao e Exportacao Ltda"
        wnctrl->WN_CLIRED := "Benystar"
        wnctrl->WN_DATEXP := ctod("12/12/99")
        wnctrl->WN_SYSTEM := .f.
        wnctrl->WN_REINDX := .f.
        wnctrl->WN_NSERIE := 55555555
        wnctrl->WN_CODSUP :=       0
        wnctrl->WN_CODVEN :=      999
        wnctrl->WN_PEDIDO :=        0
        wnctrl->WN_CIDADE := "Sao Paulo"
        wnctrl->WN_PEDINI := 0
        wnctrl->WN_PEDFIM := 999999
        wnctrl->WN_NUGUIA :=   10
        wnctrl->WN_NCPROD :=    6
        wnctrl->WN_PORCEN :=    50.00
        wnctrl->WN_CODCFO :=  0
        wnctrl->WN_NNF    :=  0

        close wnctrl
     endif

  if ! file('prod.dbf')
       matprod := {;
       {"PR_CCODPRO",     "C",        10,      0},;
       {"PR_CCODFOR",     "C",         5,      0},;
       {"PR_CNOMPRO",     "C",        45,      0},;
       {"PR_CNOMPR1",     "C",        45,      0},;
       {"PR_NCFT",        "N",         5,      2},;
       {"PR_NCOTA",       "N",         6,      2},;
       {"PR_NNUMGI",      "N",        13,      0},;
       {"PR_NNUMDI",      "N",         6,      0},;
       {"PR_NDIE",        "N",        10,      0},;
       {"PR_DDATEDI",     "D",         8,      0},;
       {"PR_NCLASFI",     "N",        10,      0},;
       {"PR_NQTY",        "N",         7,      0},;
       {"PR_CUNID",       "C",         2,      0},;
       {"PR_NQTY_CX",     "N",         7,      0},;
       {"PR_CFT",         "N",         6,      2},;
       {"PR_NSALDO",      "N",         7,      0},;
       {"PR_NPESOLI",     "N",         6,      2},;
       {"PR_NPESOBR",     "N",         6,      2},;
       {"PR_CSITTRI",     "C",         2,      0},;
       {"PR_NIPI",        "N",         3,      0},;
       {"PR_NPRECUS",     "N",        14,      2},;
       {"PR_NPREUNI",     "N",        14,      2},;
       {"PR_NPORCEN",     "N",         3,      0},;
       {"PR_NPRECO1",     "N",        14,      2},;
       {"PR_NPRECO2",     "N",        14,      2},;
       {"PR_NPRECO3",     "N",        14,      2},;
       {"PR_NPRECO4",     "N",        14,      2},;
       {"PR_NPREVEN",     "N",        14,      2},;
       {"PR_DDATCAD",     "D",         8,      0},;
       {"PR_DDATULT",     "D",         8,      0} }

       dbcreate('prod.dbf',matprod)
       use prod  Shared New alias PR
       index on pr_ccodpro tag ccodpro
       index on pr_cnompro tag cnompro
       index on pr_cnompr1 tag cnompr1
       index on pr_ccodfor tag ccodfor
       close PR
    endif
    if file('prod.cdx')=.t.
       ferase('prod.cdx')
    endif
    if file('ccodp.cdx')=.f.
        use prod Shared New alias PR
        index on pr_ccodpro to ccodp
        close PR
    endif
    if file('prod.cdx')=.f.
         use prod index ccodp Shared New alias PR
         index on pr_ccodpro tag ccodpro
         index on pr_cnompro tag cnompro
         index on pr_cnompr1 tag cnompr1
         index on pr_ccodfor tag ccodfor
         index on pr_ccodpro to ccodp
         close PR
    endif

  if ! file('estoque.dbf')
       matEST := {;
       {"CCODPRO",     "C",        10,      0},;
       {"NGI",         "N",        13,      0},;
       {"NDI",         "N",         6,      0},;
       {"NDIE",        "N",        10,      0},;
       {"DDI",         "D",         8,      0},;
       {"DDATCAD",     "D",         8,      0},;
       {"DDATENT1",    "D",         8,      0},;
       {"DDATENT2",    "D",         8,      0},;
       {"DDATENT3",    "D",         8,      0},;
       {"DDATSAI1",    "D",         8,      0},;
       {"DDATSAI2",    "D",         8,      0},;
       {"DDATSAI3",    "D",         8,      0},;
       {"NQTY",        "N",         7,      0},;
       {"QTYE1",       "N",         7,      0},;
       {"QTYE2",       "N",         7,      0},;
       {"QTYE3",       "N",         7,      0},;
       {"QTYS1",       "N",         7,      0},;
       {"QTYS2",       "N",         7,      0},;
       {"QTYS3",       "N",         7,      0},;
       {"SEL",         "L",         1,      0},;
       {"NQTYCX",      "N",         9,      2} }
       dbcreate('estoque.dbf',matEST)
       use estoque  Shared New alias ET
       index on ccodpro tag eccodpro
       index on ngi     tag engi
       index on nqtycx  tag enqtycx
       index on ccodpro to eccodp
       close ET
    endif
    if file('estoque.cdx')=.t.
       ferase('estoque.cdx')
    endif
      if file('eccodp.cdx')=.f.
        use estoque Shared New alias ET
        index on ccodpro to eccodp
        close ET
      endif

    if file('estoque.cdx')=.f.
       use estoque index eccodp Shared New alias ET
       index on ccodpro tag eccodpro
       index on ngi     tag engi
       index on nqtycx  tag enqtycx
       index on ccodpro to eccodp
       close ET
    endif


    if ! file('clientes.dbf')
        matclien := {;
        {"CL_NCODCLI",     "N",         5,      0},;
        {"CL_CNOMCFO",     "C",        40,      0},;
        {"CL_CNOMFAN",     "C",        15,      0},;
        {"CL_CENDCFO",     "C",        40,      0},;
        {"CL_CLOCENT",     "C",        40,      0},;
        {"CL_CBAICFO",     "C",        20,      0},;
        {"CL_CCIDCFO",     "C",        20,      0},;
        {"CL_CESTCFO",     "C",         2,      0},;
        {"CL_NCEPCFO",     "C",         8,      0},;
        {"CL_CCONTAT",     "C",        15,      0},;
        {"CL_CFONE1",      "C",        19,      0},;
        {"CL_CFAX",        "C",        19,      0},;
        {"CL_CPESSOA",     "C",         1,      0},;
        {"CL_NCGCCLI",     "C",        14,      0},;
        {"CL_CINSCLI",     "C",        15,      0},;
        {"CL_XFLGENT",     "C",         1,      0},;
        {"CL_XFLGCOB",     "C",         1,      0},;
        {"CL_CCLIFOR",     "C",         1,      0},;
        {"CL_NNUMMOV",     "N",         5,      0},;
        {"CL_DDATCAD",     "D",         8,      0},;
        {"CL_DDATULS",     "D",         8,      0},;
        {"CL_VPREULS",     "N",        14,      2},;
        {"CL_MOBS",        "M",        10,      0},;
        {"CL_NTRANSP",     "N",         4,      0},;
        {"CL_TRANSP",      "C",        40,      0},;
        {"CL_NVENDER",     "N",         4,      0},;
        {"CL_CFONE2",      "C",        19,      0},;
        {"CL_CTIPOCL",     "C",         3,      0} }

        dbcreate('clientes.dbf',matclien)
        use clientes  Shared New alias CFO
        index on cl_ncodcli tag ncodcli
        index on cl_cnomcfo tag cnomcfo
        index on cl_cnomfan tag cnomfan
*        index on cl_ncodcli to ncodc
        close CFO
    endif
    if file('clientes.cdx')=.t.
       ferase('clientes.cdx')
    endif
    if file('ncodc.cdx')=.f.
        use clientes  Shared New alias CFO
        index on cl_ncodcli to ncodc
        close CFO
    endif
    if file('clientes.cdx')=.f.
        use clientes index ncodc Shared New alias CFO
        index on cl_ncodcli tag ncodcli
        index on cl_cnomcfo tag cnomcfo
        index on cl_cnomfan tag cnomfan
        index on cl_ncodcli to ncodc
        close CFO
    endif

    if ! file('pedidoma.dbf')
        matpedma := { ;
        {"PM_NPEDIDO",     "N",         5,      0},;
        {"PM_NNF",         "N",         5,      0},;
        {"PM_CTIPO",       "C",         1,      0},;
        {"PM_CNATOPE",     "C",         3,      0},;
        {"PM_NVENDER",     "N",         4,      0},;
        {"PM_DDATPED",     "D",         8,      0},;
        {"CL_NCODCLI",     "N",         5,      0},;
        {"PM_DDATENT",     "D",         8,      0},;
        {"PM_NCODTRA",     "N",         4,      0},;
        {"PM_CTAB",        "C",         9,      0},;
        {"PM_NTAB",        "N",         4,      2},;
        {"PM_NCOMIS",      "N",         4,      2},;
        {"PM_NDESC",       "N",         3,      0},;
        {"PM_CCONDPG",     "C",         5,      0},;
        {"PM_CLOCENT",     "C",        40,      0},;
        {"PM_NTITEM",      "N",         3,      0},;
        {"PM_NTVOL",       "N",         4,      0},;
        {"PM_NPESOL",      "N",         7,      2},;
        {"PM_NPESOB",      "N",         7,      2},;
        {"PM_NTDESC",      "N",         8,      2},;
        {"PM_NTICMS",      "N",         8,      2},;
        {"PM_NTIPI",       "N",         8,      2},;
        {"PM_NTOTAL",      "N",         8,      2},;
        {"PM_NSUBTOT",     "N",         8,      2},;
        {"PM_DDATPAG",     "D",         8,      0},;
        {"PM_LPAG",        "L",         1,      0},;
        {"PM_NTOTPED",     "N",        14,      2}}
*       {"PM_CNOMCFO",     "C",        40,      0}}

        dbcreate('pedidoma.dbf',matpedma)
        use pedidoma  Shared New alias PEDM
        index on pm_npedido tag npedidoma
        index on pm_nnf     tag nnfma
        index on pm_ddatped tag datpedma
*        index on pm_cnomcfo tag nomcfoma
*       index on cl_ncodcli tag ncodcli
*        index on pm_npedido to npedido
        close PEDM
    endif
    if file('pedidoma.cdx')=.t.
       ferase('pedidoma.cdx')
    endif
    if file('npedido.cdx')=.f.
        use pedidoma Shared New alias PEDM
        index on pm_npedido to npedido
        close PEDM
    endif
    if  file('pedidoma.cdx') = .f.
        use pedidoma index npedido Shared New alias PEDM
        index on pm_npedido tag npedidoma
        index on pm_nnf     tag nnfma
        index on pm_ddatped tag datpedma
*       index on pm_cnomcfo tag nomcfoma
        index on cl_ncodcli tag ncodcli
        index on pm_npedido to npedido
        close PEDM
    endif

    if ! file('pedidosi.dbf')
        matpedsi := {;
        {"PI_NPEDIDO",     "N",         5,      0},;
        {"PI_CCODPRO",     "C",        10,      0},;
        {"PI_NPREVEN",     "N",        14,      2},;
        {"PI_NPREUNI",     "N",        14,      2},;
        {"PI_NQTY",        "N",         6,      0}}
        dbcreate('pedidosi.dbf',matpedsi)
        use pedidosi  Shared New alias PEDI
        index on pi_npedido tag npeditem
        index on pi_ccodpro tag codproit
        close PEDI
    endif
    if file('pedidosi.cdx')=.t.
       ferase('pedidosi.cdx')
    endif
    if file('npedit.cdx')=.f.
        use pedidosi Shared New alias PEDI
        index on pi_npedido to npedit
        close PEDI
    endif
    if file('ncodit.cdx')=.f.
        use pedidosi Shared New alias PEDI
        index on pi_ccodpro to ncodit
        close PEDI
    endif
    if file('pedidosi.cdx') = .f.
        use pedidosi index npedit,ncodit Shared New alias PEDI
        index on pi_npedido tag npeditem
        index on pi_ccodpro tag codproit
        index on pi_npedido to npedit
        index on pi_ccodpro to ncodit
        close PEDI
    endif

    if file('temp.dbf') = .f.
        matpedtp:= {;
        {"TP_NPEDIDO",     "N",         5,      0},;
        {"CODIGO",         "C",        10,      0},;
        {"PRECO_VEND",     "N",        14,      2},;
        {"PRECO_UNIT",     "N",        14,      2},;
        {"QTY",            "N",         6,      0},;
        {"DESCRICAO",      "C",        45,      0} }
        dbcreate('temp.dbf',matpedtp)
        use temp  Shared New alias TP
        index on tp_npedido tag npedidotp
        index on CODIGO tag ccodprotp
*        index on tp_npedido  to npedtp
        index on CODIGO  to ncodtp
        close TP
    endif
    if file('temp.cdx') = .t.
       ferase('temp.cdx')
    endif
    if file('ncodtp.cdx')=.f.
        use temp Shared New alias TP
        index on CODIGO  to ncodtp
        close TP
    endif
    if file('temp.cdx') = .f.
        use temp index ncodtp Shared New alias TP
        index on tp_npedido tag npedidotp
        index on CODIGO tag ccodprotp
*        index on tp_npedido  to npedtp
        index on CODIGO  to ncodtp
        close TP
    endif

    if file('transpor.dbf') = .f.
        mattrans:= {;
        {"TR_NCODTRA",     "N",         4,      0},;
        {"TR_XNOMTRA",     "C",        40,      0},;
        {"TR_XENDTRA",     "C",        40,      0},;
        {"TR_XCIDTRA",     "C",        20,      0},;
        {"TR_XESTTRA",     "C",         2,      0},;
        {"TR_XCEPTRA",     "N",         8,      0},;
        {"TR_XVIATRA",     "C",         1,      0},;
        {"TR_XTELTRA",     "C",        14,      0},;
        {"TR_CNOMRED",     "C",        20,      0}}
        dbcreate('transpor.dbf',mattrans)
        use transpor Shared New alias TR
        index on TR_NCODTRA tag NCODTRA
        index on TR_XNOMTRA tag XNOMTRA
        index on TR_CNOMRED tag CNOMRED
*        index on tr_ncodtra to ncodt
        close TR
    endif
    if file('transpor.cdx')=.t.
       ferase('transpor.cdx')
    endif
    if file('ncodt.cdx')=.f.
        use transpor Shared New alias TR
        index on tr_ncodtra to ncodt
        close TR
    endif
    if file('transpor.cdx') = .f.
        use transpor index ncodt Shared New alias TR
        index on TR_NCODTRA tag NCODTRA
        index on TR_XNOMTRA tag XNOMTRA
        index on TR_CNOMRED tag CNOMRED
        index on tr_ncodtra to ncodt
        close TR
    endif




    if file('vendedor.dbf') = .f.
        matVEND:= {;
        {"VE_NCODVEN",     "N",         3,      0},;
        {"VE_CNOMVEN",     "C",        40,      0},;
        {"VE_CENDVEN",     "C",        40,      0},;
        {"VE_CCIDVEN",     "C",        20,      0},;
        {"VE_CESTVEN",     "C",         2,      0},;
        {"VE_CCEPVEN",     "C",         8,      0},;
        {"VE_CTELVEN",     "C",        14,      0},;
        {"VE_CCELVEN",     "C",        14,      0},;
        {"VE_CFAXVEN",     "C",        14,      0},;
        {"VE_CNOMRED",     "C",        20,      0}}
        dbcreate('vendedor.dbf',matVEND)
        use vendedor Shared New alias VENDEDOR

        index on VE_NCODVEN tag NCODVEN
        index on VE_CNOMVEN tag CNOMVEN
        index on VE_CNOMRED tag CVENRED
*        index on ve_ncodven to ncodv
        close vendedor
    endif
    if file('vendedor.cdx')=.t.
       ferase('vendedor.cdx')
    endif
    if file('ncodv.cdx')=.f.
        use vendedor Shared New alias vendedor
        index on ve_ncodven to ncodv
        close vendedor
    endif
    if file('vendedor.cdx') = .f.
        use vendedor index ncodv Shared New alias vendedor
        index on VE_NCODVEN tag NCODVEN
        index on VE_CNOMVEN tag CNOMVEN
        index on VE_CNOMRED tag CVENRED
        index on VE_NCODVEN to ncodv
        close vendedor
    endif


    if file('cfn.dbf') = .f.
        matcfn:= {;
        {"TELE",         "C",        16,      0},;
        {"BO",           "C",        40,      0},;
        {"DBFNAME",      "C",        18,      0},;
        {"FIDARR",       "C",       253,      0},;
        {"FO",           "C",         5,      0},;
        {"EXPRC",        "N",       253,      0},;
        {"FIDCRR",       "C",       253,      0},;
        {"FIDSUM",       "C",        20,      0},;
        {"FIDSUB",       "C",        20,      0},;
        {"FLG",          "N",         1,      0},;
        {"DDATCAD",      "D",         8,      0},;
        {"DESCRICAO",    "C",        80,      0}}
        dbcreate('cfn.dbf',matcfn)
        use cfn Shared New alias CFN
        index on tele to ctel
        close CFN
    endif
    if file('cfn.cdx')=.t.
       ferase('cfn.cdx')
    endif
    if file('ctel.cdx')=.f.
        use cfn Shared New alias CFN
        index on tele to ctel
        close CFN
    endif
*    if file('cfn.cdx') = .f.
*        use cfn index ctel Shared New alias CFN
*        index on tele to ctel
*        close CFN
*    endif

 && Mestre de Pedidos
use pedidoma index npedido Shared New alias PEDM
Disp_mens({"Reindexacao de Mestre de Pedidos"},.f.)
nCount := DispBar()
index on dacCount(str(PEDM->pm_npedido,5,0),@nCount) tag npedidoma
nCount := DispBar()
index on dacCount(str(PEDM->pm_nnf,0),@nCount) tag nnfma
nCount := DispBar()
index on dacCount(str(PEDM->cl_ncodcli,5,0),@nCount) tag ncodcli
nCount := DispBar()
index on dacCount(DTOS(PEDM->pm_ddatped),@nCount) tag datpedma
nCount := DispBar()
*index on dacCount(PEDM->pm_cnomcfo,@nCount) tag nomcfoma
*nCount := DispBar()
index on dacCount(str(PEDM->cl_ncodcli,5,0),@nCount) to codclima
index on pm_npedido to npedido

&& Pedido de Item
use pedidosi index npedit Shared New alias PEDI
Disp_mens({"Reindexacao de Itens de Pedidos"},.f.)
nCount := DispBar()
index on dacCount(str(PEDI->pi_npedido,5,0),@nCount) tag npeditem
nCount := DispBar()
index on dacCount(PEDI->pi_ccodpro,@nCount) tag codproit
index on pi_npedido to npedit

/*SELE 3
use condpgto alias CP
Disp_mens({"Reindexacao de Condicoes de Pagamento"},.f.)
nCount := DispBar()
index on dacCount(STR(CP->cp_ncodpgt,0), @nCount) to condpgt1
nCount := DispBar()
index on dacCount(CP->cp_xnompgt, @nCount)        to condpgt2
*/
&& Transporte
use transpor INDEX ncodt Shared New alias TR
Disp_mens({"Reindexacao de Transportadoras"},.f.)
nCount := DispBar()
index on dacCount(STR(TR->tr_ncodtra,4,0), @nCount) tag ncodtra
nCount := DispBar()
index on dacCount(TR->tr_xnomtra, @nCount)          tag xnomtra
set order to tag ncodtra
index on tr_ncodtra to ncodt

&& clientes
use clientes index ncodc Shared New alias CFO
Disp_mens({"Reindexacao de Clientes"},.f.)
nCount := DispBar()
index on dacCount(str(CFO->cl_ncodcli,5,0), @nCount)  tag  ncodcli
nCount := DispBar()
index on dacCount(CFO->cl_cnomcfo, @nCount)           tag cnomcfo
nCount := DispBar()
index on dacCount(CFO->cl_cnomfan, @nCount)           tag cnomfan
*nCount := DispBar()
*index on dacCount(str(CFO->cl_ncgccli,14,0), @nCount) tag ncgccli
set order to tag ncodcli
nCount := DispBar()
index on cl_ncodcli to ncodc

/*use dachelp Shared New alias HELP
Disp_mens({"Reindexacao de HELPS"},.f.)
nCount := DispBar()
index on dacCount(HELP->hp_xvarhlp, @nCount)        tag  dachelp
*/
&& Produtos
use prod index ccodp Shared New alias PR
Disp_mens({"Reindexacao de Produtos"},.f.)
nCount := DispBar()
index on dacCount(PR->pr_ccodpro, @nCount)   tag ccodpro
nCount := DispBar()
index on dacCount(PR->pr_cnompro, @nCount)   tag cnompro
nCount := DispBar()
index on dacCount(PR->pr_cnompr1, @nCount)   tag cnompr1
nCount := DispBar()
index on dacCount(PR->pr_ccodfor, @nCount)  tag ccodfor
index on pr_ccodpro to ccodp
close PR

&& Estoque
       use estoque index eccodp Shared New alias ET
       index on ccodpro tag eccodpro
       index on ngi     tag engi
       index on nqtycx  tag enqtycx
       index on ccodpro to eccodp
       close ET


&& vendedor
        use vendedor index ncodv Shared New alias vendedor
        index on VE_NCODVEN tag NCODVEN
        index on VE_CNOMVEN tag CNOMVEN
        index on VE_CNOMRED tag CVENRED
        index on VE_NCODVEN to ncodv
        close vendedor


&& arquivo temporario
       use CFN index ctel Shared New alias CFN
       index on tele to ctel
*       use CFNTEMPO Shared New alias CFNT
       close CFN
/*
use entrcobr Shared New alias EC
Disp_mens({"Reindexacao de Entrega/Cobranca"},.f.)
nCount := DispBar()
index on dacCount(EC->ec_xentcob + str(EC->ec_ncgccfo,14,0), @nCount) tag entrcob1
*/
&& Temporario
use temp index ncodtp Shared New alias TP
Disp_mens({"Reindexacao de Entrega/Cobranca"},.f.)
nCount := DispBar()
index on dacCount(str(TP->tp_npedido,5,0), @nCount) to npedidotp
nCount := DispBar()
index on dacCount(TP->CODIGO, @nCount) to ccodprotp
*index on tp_npedido  to npedtp
index on CODIGO  to ncodtp
RestScreen(10,18,21,61,xTela)

close databases

 use clientes index ncodc Shared New alias CFO
 use pedidoma index npedido Shared New alias PEDM
 set relation  to PEDM->cl_ncodcli into CFO
       index on CFO->cl_cnomcfo tag nomcfoma
close databases
use wnctrl Shared New alias wnctrl
Use usuario alias US Shared New
RETURN

Function DispBar()
LOCAL nCount := 0
Public nRec
@ 19,18,21,61 BOX B_DOUBLE
@ 20,19 clear to 20,60
@ 20,20 say chr(219)
nCount := 0
nRec := Reccount() / 40
return nCount

Function dacCount(xStr, nCount)
*Public nRec
IF  nCount == NIL
    RETURN xStr
END
nCount ++
if nCount > nRec
   @ 20, col() say chr(219)
   nCount := 0
endif
RETURN xStr

